﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using lgweb.common;
using LGCourt.Logic.BLL;
using KMFrame.Core;
using LGCourt.Logic.NBL.DBEntities;

namespace lgweb.inside.office
{
    public partial class scheduling : NeedValidatePage
    {
        private int _pageIndex = 1;
        protected new void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);
            if (!this.IsPostBack)
            {
                GetParam();
                GetList();
                //this.hdOADomain.Value = System.Configuration.ConfigurationManager.AppSettings["OADomain"];
            }
        }

        private void GetParam()
        {
            this._pageIndex = string.IsNullOrEmpty(Request.QueryString["PageIndex"]) ? 1 : Convert.ToInt32(Request.QueryString["PageIndex"]);
        }

        private void GetList()
        {
            OA bll = new OA();
            OACondition param = new OACondition();
            param.UserID = this.SessionInfo.UserID;
            param.PageSize = 20;
            param.PageIndex = this._pageIndex;

            PageResult result = (PageResult)bll.GetKaitingPaiqiPage(param);

            if (result != null && result.ResultList != null)
            {
                this.rptAddressList.DataSource = (List<pKTPQ>)result.ResultList;
                this.rptAddressList.DataBind();
                this.pager1.RecordCount = result.TotalCount;
                this.pager1.TotalPage = result.PageCount;
                this.pager1.PageIndex = this._pageIndex;
                this.pager1.PageSize = 20;
                this.pager1.LinkUrl = string.Format("/inside/office/scheduling.aspx?PageIndex={0}", this._pageIndex);
            }
        }
    }
}